﻿{% extends "xadmin/views/model_list.html" %}
{% load static %}
{% block toolbar_layouts %}{% endblock toolbar_layouts %}
{% block results_grid_body %}{% endblock results_grid_body %}

{% block results_grid %}
<style>
.box-comments{
  background-color: #fff;
}
</style>
<div class="box box-widget">
  <div class="box-header with-border">
    <div class="user-block">
      <img class="img-circle" src="{% static 'xadmin/img/default_user.png' %}" alt="User Image">
      <span class="username"><a href="#">{{user}}</a></span>
      <span class="description">{{user.group}}</span>
    </div>
    <!-- /.user-block -->
    <div class="box-tools">
      {% for o in result_headers.cells %}{% if not forloop.first %}
      <div class="btn btn-box-tool">
        {% if o.btns %}
        <div class="pull-right">
          {% for b in o.btns %}
          {{b|safe}}
          {% endfor %}
        </div>
        &nbsp;
        {% endif %}
        {% if o.menus %}
        <div class="dropdown pull-left">
          <a class="dropdown-toggle" data-toggle="dropdown" href="#">
            {{ o.label }}
          </a>
          <ul class="dropdown-menu" role="menu">
            {% for m in o.menus %}
            {{m|safe}}
            {% endfor %}
          </ul>
        </div>
        {% else %}
        {{ o.label }}
        {% endif %}
      </div>{% endif %}{% endfor %}
      </div>
    <!-- /.box-tools -->
  </div>
  <!-- /.box-header -->
  <!-- /.box-body -->
  <div class="box-body box-comments">
    {% for obj in results %}
    <!-- /.box-comment -->
    <div class="box-comment">
      <!-- User image -->
      <span class="img-circle img-sm"><i class="fa fa-envelope-o" aria-hidden="true"></i></span>
      <!-- <img class="img-circle img-sm" src="../dist/img/user4-128x128.jpg" alt="User Image"> -->

      <div class="comment-text">
        <span class="username">
          {{obj.object.title}}
          <span class="text-muted pull-right">{{obj.object.createdat}}-{{obj.object.createdat|date:"D"}}</span>
        </span><!-- /.username -->
        {{obj.object.content|safe}}
        
        {% for o in obj.cells %}
        {% if forloop.last %}
        <p>
          {% if o.btns %}
          <div class="btn-group">
            {% for b in o.btns %}
            {{b|safe}}
            {% endfor %}
          </div>
          {% endif %}
          {% if o.menus %}
          <div class="dropdown">
            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
              {{ o.label }}
            </a>
            <ul class="dropdown-menu">
              {% for m in o.menus %}
              {{m|safe}}
              {% endfor %}
            </ul>
          </div>
          {% else %}
          {{ o.label }}
          {% endif %}
        </p>
        {% endif %}
        {% endfor %}
      </div>
      <!-- /.comment-text -->
    </div>
    {% endfor %}
    <!-- /.box-comment -->
  </div>
  <!-- /.box-footer -->
</div>
{% endblock results_grid %}